package cn.com.open.itembank;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
@ServletComponentScan
@EnableCaching
@EnableTransactionManagement
@RefreshScope
@EnableDiscoveryClient
@EnableFeignClients
@EnableScheduling  //定时器总开关
public class BaseApplication {
    @Value("${app.name}")
    private String name;

    @RequestMapping(value = "/version", method = RequestMethod.GET)
    public String version() {
        return name;
    }

    @RequestMapping(value = "/dnotdelet/mom.html", method = RequestMethod.GET)
    public String home() {
        return "helloworld!";
    }

    public static void main(String[] args) {
        SpringApplication.run(BaseApplication.class, args);
    }
}
